<?php

/*
*###########################################################################################################################*
#																														#
#																														#
#**  ** ****** ** **  **  ****** ** ***   ** ***   ****** ** **  **  ** **  ** ** **  ******   ** **  **  ******#
#**  ** ****** ********** ****** *******  *******  ****** ********** ** **  ** **********  ******  ********** ******#
#**  ** **  ** **  **  ** ** ***   ** **** ** **  **  ****  ** **  **  ** ***   ** **  **  ** **#
#****** **  ** **  **  ** ****** **   *** **   *** ****** **  **  ** ** **  ** **  **  ** **   **  **  ** ******#
#****** **  ** **  **  ** ****** *******  *******  ****** **  **  ** ** **  ** **  **  ** **   **  **  ** ******#
#**  ** **  ** **  **  ** ** ***********   ** **  **  ** ** **  ** **  **  ** ***   ** **  **  ** **#
#**  ** ****** **  **  ** ****** **   **  ***  ****** **  **  ** ** ****** **  **  **  ******  **  **  ** ******#
#**  ** ****** **  **  ** ****** **   **   *** ****** **  **  ** **  ** ** **  **  **   ****   **  **  ** ******#
#																														#
#																														#
#																														#
#2010 - 2011 © HomePremiumCMS made by HomePemium as PremiumEye & Security by HomePremium and Merijnz				#
#																														#
#Powered by PhoenixPHP 3.7.1 (build 138000)																			#
#																														#
#																														#
#																														#
*###########################################################################################################################*
*/

define('USERNAME_REQUIRED', TRUE);
define('ACCOUNT_REQUIRED', TRUE);
include('global.php');
define("THIS_SCRIPT", 'articles');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head>
	<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
	<title><?php echo $sitename." - ".$lang['articles'];; ?></title>
<link type="text/css" rel="stylesheet" href="Public/Styles/<?php echo $currentstyle ?>/CSS/main.css" />
</head> 

<body id="news_body"> 

	<?php include("system/header_com.php"); ?>
    
	<div class="mainBox"> 
    
	<?php include("system/communitynav.php"); ?>
    
		<div class="mid" id="midcontent" style="margin-left: -4px;"> 
        
			<?php 
			if(!isset($_GET['story']) || !is_numeric($_GET['story'])){
				
				$articleq = mysql_query("SELECT * FROM cms_news ORDER BY id DESC LIMIT 1");
				
			}else{
				
				$articleq = mysql_query("SELECT * FROM cms_news WHERE id = '".addslashes($core->EscapeString($_GET['story']))."' LIMIT 1");
				
			}
			
			$article = mysql_fetch_array($articleq);
			
			$authorq = mysql_query("SELECT * FROM users WHERE id = '".$article['author']."' LIMIT 1");
			
			$author = mysql_fetch_array($authorq);
			
			$recentstoriesq = mysql_query("SELECT * FROM cms_news  ORDER BY id DESC LIMIT 25");
			?>
            
			<style type="text/css">
			#column1 > div.contentBox a {
				color: #FC6204;
			}

			#column1 > div.contentBox a:hover {
				font-weight: bold;
			}
			</style>
            
			<div class="column" id="column1">
            
				<div class="xs_boxHeader_orange">
                
					<div class="titel">
                    
						<?php echo $lang['news_right_title']; ?>
                        
					</div>
                    
				</div>
                
				<div class="contentBox">
                
					<div class="boxContent">
                    	
						<div class="title_news">
                        
							<?php echo $lang['news_right_title']; ?>
                            
						</div>
                        
						<?php 
						$query = mysql_query("SELECT * FROM cms_news WHERE published ORDER BY published DESC");
						
						$num = mysql_num_rows($query);
						
						if($num > 0){
							
							while($campaign = mysql_fetch_array($query))
							{
						
								if($_GET['story'] == $campaign['id'] )
								{
						?>
                        
								<div class="headline selected">
                                
									<?php echo strip_tags($campaign['title']); ?>
                                    
								</div>
                                
						<?php }else{ ?>
                        
								<div class="headline">
                                
									<a href="articles.php?story=<?php echo $campaign['id']; ?>"><?php echo strip_tags($campaign['title']); ?> &raquo;</a>
                                    
								</div>
                                
						<?php
								}
							}
						}
						?>
                        
					</div>
                    
				</div>
                
				<div class="xs_boxBottom"></div>
                
			</div>
            
			<div style="float: left;" class="column" id="column2">
            
				<div style="margin-left: 5px; padding-top: 2px;" class="boxHeader_news">
                
					<div class="news_titel" style="font-size: 15px;">
                    
						<?php echo stripslashes($article['title']); ?>
                        
					</div>
                    
				</div>

				<div style="margin-left: 5px; width: 518px;" class="contentBox">
                
					<div class="boxContent">
                    
						<div class="story">
                        
							<b><?php echo stripslashes($article['shortstory']); ?></b>
                            
							<br />
                            
							<?php echo html_entity_decode($article['longstory']); ?>
                            
						</div>
                        
						<div class="extrainfo">
                        
							<div class="poster">
                            
								<?php echo $lang['author']; ?>: 
                                
								<font onclick="home.php?u=<?php echo $author['username']; ?>" style="cursor:pointer;">
                                
									<?php echo $author['username']; ?>
                                    
								</font>
                                
							</div>
                            
							<div class="date">
                            
								<?php echo $lang['published']; ?>: 
                                
								<?php echo @date("d-m-Y",$article['published']); ?>
                                
							</div>
                            
						</div>
                        
					</div>
                    
				</div>
                
				<div style="margin-left: 5px;" class="xl_boxBottom"></div>
                
			</div>
            
		<?php include("system/sideads.php"); ?>
        
	</div> 
    
	<?php include("system/footer.php"); ?>
    
</div> 
</body> 
</html>